<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Hope2</title>

    <link rel="stylesheet" href="https://lib.baomitu.com/bulma/0.9.1/css/bulma.css">
    <link rel="shortcut icon" href="/favicon.ico">
    <script src="https://lib.baomitu.com/jquery/3.5.1/jquery.min.js"></script>
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://www.datatables.net/rss.xml">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css">
    <script type="text/javascript" language="javascript"
            src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript">
        // var chart;
        var link = 'http://127.0.0.1:8003/gaokao';
        link = '/gaokao';
        var table;
        $(document).ready(function () {
            table = $('#table').DataTable({
                // data: result,
                order: [[2, "desc"]],
                columns: [
                    {
                        data: 'college'
                    },
                    {data: 'major'},
                    {data: 'score'},
                    {data: 'position'}

                ]
            });
        });

        function post() {
            var type = $("#type").val();
            var college = $("#college").val();
            var mayjor = $("#mayjor").val();

            var lowScore = $("#lowScore").val();
            var highScore = $("#highScore").val();

            var lowPosition = $("#lowPosition").val();
            var highPosition = $("#highPosition").val();

            var data = {
                'type': type,
                'college': college,
                'mayjor': mayjor,
                'lowScore': lowScore,
                'highScore': highScore,
                'lowPosition': lowPosition,
                'highPosition': highPosition
            };
            $.post(link, data, function (result) {
                table.clear().rows.add(result).draw();
            });

        }
    </script>
</head>


<body class="layout-default">
<nav id="navbar" class="bd-navbar navbar has-shadow is-spaced">
    <div class="container">
        <div class="navbar-brand">
            <a class="navbar-item" href="https://qianyitian.com/">
                <img style="height:36px;width:36px;" src="https://img.qianyitian.com/icon/logo.png">  <h4
                    class="title is-3">Hope2</h4>
            </a>
        </div>
    </div>
</nav>
<section class="hero is-light is-info">
    <div class="hero-body">
        <div class="container">
            <h1 class="title">
                辽宁省2021年投档分查询
            </h1>
        </div>
    </div>
</section>
<section class="section">
    <div class="container">
        <div class="columns">
            <div class="column is-3">
                <div class="field">
                    <label class="label">类别</label>
                    <div class="control">
                        <div class="select">
                            <select id="type">
                                <option value="wenke">文科-历史学科类</option>
                                <option value="like">理科-物理学科类</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div class="columns">
            <div class="column is-3">
                <div class="field">
                    <label class="label">学校名称</label>
                    <div class="control">
                        <input id="college" class="input is-success" type="text">
                    </div>
                </div>

                <div class="field">
                    <label class="label">专业名称</label>
                    <div class="control ">
                        <input id="mayjor" class="input is-success" type="text">
                    </div>
                </div>

                <div class="field is-grouped">
                    <div class="control">
                        <button class="button is-link" onclick="post()">查询</button>
                    </div>
                </div>
            </div>
            <div class="column is-1">
            </div>
            <div class="column is-2">
                <div class="field">
                    <label class="label">最低分</label>
                    <div class="control">
                        <input id="lowScore" class="input is-success" type="text">
                    </div>
                </div>

                <div class="field">
                    <label class="label">最高分</label>
                    <div class="control ">
                        <input id="highScore" class="input is-success" type="text">
                    </div>
                </div>
            </div>
            <div class="column is-1">
            </div>
            <div class="column is-2">
                <div class="field">
                    <label class="label">最低名次</label>
                    <div class="control">
                        <input id="lowPosition" class="input is-success" type="text">
                    </div>
                </div>

                <div class="field">
                    <label class="label">最高名次</label>
                    <div class="control ">
                        <input id="highPosition" class="input is-success" type="text">
                    </div>
                </div>
            </div>


        </div>
    </div>
</section>
<section class="section">
    <div class="container">
        <table id="table" class="display compact" style="width:100%">
            <thead>
            <tr>
                <th>学校名称</th>
                <th>专业名称</th>
                <th>分数线</th>
                <th>名次</th>
            </tr>
            </thead>
        </table>
    </div>
</section>

</body>
</html>
